package swing_UI;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextField;

public class ConnectDialog extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8400042794022174230L;
	private final JPanel contentPanel = new JPanel();
	private JTextField txtJkaene;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			ConnectDialog dialog = new ConnectDialog();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public ConnectDialog() {
		setBounds(100, 100, 450, 163);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		
		JLabel lblUsername = new JLabel("Username:");
		lblUsername.setBounds(10, 11, 107, 14);
		contentPanel.add(lblUsername);
		
		JLabel lblToken = new JLabel("Token:");
		lblToken.setBounds(10, 54, 46, 14);
		contentPanel.add(lblToken);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"French Fries", "Pizza", "Chicken Wings", "Beer", "Burger", "Poutine", "Nachoes", "Chocolate Cake"}));
		comboBox.setBounds(89, 8, 184, 20);
		contentPanel.add(comboBox);
		
		txtJkaene = new JTextField();
		txtJkaene.setText("JKAENE");
		txtJkaene.setBounds(89, 51, 153, 20);
		contentPanel.add(txtJkaene);
		txtJkaene.setColumns(10);
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			
			JButton btnApplyDiscount = new JButton("Apply Discount");
			buttonPane.add(btnApplyDiscount);
			
			JButton btnPrint = new JButton("Print");
			buttonPane.add(btnPrint);
			{
				JButton okButton = new JButton("OK");
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Cancel");
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
	}
}
